﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TestWebApp
{
    public partial class ReceiveData : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string data = Request["data"] != null ? Request["data"].ToString() : "null";

            string FileName = this.MapPath("ReceivedData") + "\\" + DateTime.Now.ToString("yyyyMMddHHmm") + ".txt";
            StreamWriter FileWriter = new StreamWriter(FileName, true); //写文件


            FileWriter.Write(data);//将字符串写入
            FileWriter.Close(); //关闭StreamWriter对象
        }
    }
}